package com.bite.maven_demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.awt.print.Book;
import java.util.HashMap;
import java.util.List;

@Controller
@ResponseBody
public class IndexController {
    @RequestMapping("/index")
    public Object index(){
        return "/index.html";
    }
    @RequestMapping("/returnHtml")
    @ResponseBody
    public String returnHtml() {
        return "<h1>Hello,HTML~</h1>";
    }
    @RequestMapping("/returnJson")
    @ResponseBody
    public HashMap<String,String> returnJson() {
        HashMap<String,String> map = new HashMap<>();
        map.put("Java","Java Value");
        map.put("MySQL","MySQL Value");
        map.put("Redis","Redis Value");
        return map;
    }
    
}
